import 'dart:async';

import 'package:qgchat/bloc/blocProvider.dart';
import 'package:qgchat/http/apis/user.dart';
import 'package:qgchat/http/models/intodetailsModel.dart';

class InviteInfoBloc implements BlocBase {
  /// 邀请详情
  StreamController _inv = StreamController<List<IntodetailsModel>>.broadcast();
  Sink get _invSink => _inv.sink;
  Stream get invStream => _inv.stream;

  InviteInfoBloc(String token) {
    intodetails(token);
  }

  void dispose() {
    _inv.close();
  }

  /// 邀请明细
  void intodetails(String token) async {
    List<IntodetailsModel> result = await UserApis.intodetails(token);
    _invSink.add(result);
  }
}